package scu.maqiang.tiangong;

import scu.maqiang.mesh.Mesh3T3S;
import scu.maqiang.mesh.MeshFormat;

public class ZKEngineMeshConstructor {

	public static void main(String[] args) {
		String dir = "TianGong\\ZKEngine\\";
		String fileName = dir + "TGT200-1_a0_wall1.dat";
		Mesh3T3S mesh1 = new Mesh3T3S();
		mesh1.readMesh(MeshFormat.msh, fileName);
		mesh1.toTecplot(dir + "zkengine1.dat");
		System.out.println("Mesh1 Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
//===================================================================
		fileName = dir + "TGT200-1_a0_wall2.dat";
		Mesh3T3S mesh2 = new Mesh3T3S();
		mesh2.readMesh(MeshFormat.msh, fileName);
		mesh2.toTecplot(dir + "zkengine2.dat");
		System.out.println("Mesh2 Info: ");
		System.out.println("nv: " + mesh2.getNv() + "\tnt: " + mesh2.getNt());
		
		mesh1.add(mesh2);
		System.out.println("Mesh1 + Mesh2 Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
		mesh1.toTecplot(dir + "zkengine12.dat");
		//===================================================================		
		fileName = dir + "TGT200-1_a0_wall3.dat";
		Mesh3T3S mesh3 = new Mesh3T3S();
		mesh3.readMesh(MeshFormat.msh, fileName);
		mesh3.toTecplot(dir + "zkengine3.dat");
		System.out.println("Mesh3 Info: ");
		System.out.println("nv: " + mesh3.getNv() + "\tnt: " + mesh3.getNt());
		
		mesh1.add(mesh3);
		System.out.println("Mesh1 + Mesh2 + Mesh3 Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
		mesh1.toTecplot(dir + "zkengine123.dat");
		
		//===================================================================
		fileName = dir + "TGT200-1_a0_wall4.dat";
		Mesh3T3S mesh4 = new Mesh3T3S();
		mesh4.readMesh(MeshFormat.msh, fileName);
		mesh4.toTecplot(dir + "zkengine4.dat");
		System.out.println("Mesh4 Info: ");
		System.out.println("nv: " + mesh4.getNv() + "\tnt: " + mesh4.getNt());
		
		mesh1.add(mesh4);
		System.out.println("Mesh1 + Mesh2 + Mesh3 + Mesh4 Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
		mesh1.toTecplot(dir + "zkengine1234.dat");
		
		//===================================================================
		fileName = dir + "TGT200-1_a0_wall5.dat";
		Mesh3T3S mesh5 = new Mesh3T3S();
		mesh5.readMesh(MeshFormat.msh, fileName);
		mesh5.toTecplot(dir + "zkengine5.dat");
		System.out.println("Mesh5 Info: ");
		System.out.println("nv: " + mesh5.getNv() + "\tnt: " + mesh5.getNt());
		
		mesh1.add(mesh5);
		System.out.println("Mesh1 + Mesh2 + Mesh3 + Mesh4 + Mesh5 Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
		mesh1.toTecplot(dir + "zkengine12345.dat");
		
		//===================================================================
		fileName = dir + "TGT200-1_a0_wall6.dat";
		Mesh3T3S mesh6 = new Mesh3T3S();
		mesh6.readMesh(MeshFormat.msh, fileName);
		mesh6.toTecplot(dir + "zkengine6.dat");
		System.out.println("Mesh6 Info: ");
		System.out.println("nv: " + mesh6.getNv() + "\tnt: " + mesh6.getNt());
		
		mesh1.add(mesh6);
		System.out.println("Mesh1 + Mesh2 + Mesh3 + Mesh4 + Mesh5 + Mesh6 Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
		mesh1.toTecplot(dir + "zkengine123456.dat");
		
		//===================================================================
		Mesh3T3S Newmesh1 = new Mesh3T3S();
		Newmesh1.reflectXY(mesh1);
		Newmesh1.toTecplot(dir + "zkengineNew1.dat");
		System.out.println("MeshNew1 Info: ");
		System.out.println("nv: " + Newmesh1.getNv() + "\tnt: " + Newmesh1.getNt());
		
		mesh1.add(Newmesh1);
		System.out.println("FinalMesh Info: ");
		System.out.println("nv: " + mesh1.getNv() + "\tnt: " + mesh1.getNt());
		mesh1.toTecplot(dir + "FinalZKEngine.dat");
		
		mesh1.saveMesh(MeshFormat.msh, dir + "FinalZKEngine.mesh");

	}

}
